<template>
	<view class="colum login btheme cfff">
		<image src="../../static/logo2.png" mode="widthFix" class="logo"></image>
		<div class="text-box">
			<div class="f30">About to sign in：Coin security intelligence</div>
			<div class="f30">Please confirm that it was your own operation.</div>
			<div class="f30 mt30">Use your account to log in to this application.</div>
		</div>
		<div class="center bfff ctheme" @click="login">Authorized login</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				recommended_address: ''
			}
		},
		onLoad(e) {
			this.recommended_address = e.recommended_address || ''
		},
		methods: {
			// 登录
			login() {
				this.initWeb3((tpaddress) => {
					this.$http('user/register', {
						tpaddress,
						recommended_address: this.recommended_address
					}).then(r => {
						uni.setStorageSync('uinfo', r.userinfo)
						this.open('../index/index', 1)
					})

				})
			}
		}
	}
</script>

<style lang="scss">
	.text-box {
		border-top: 1px solid #fff;
		margin: 100rpx 40rpx;
		padding: 30rpx 20rpx;
	}

	.center {
		width: 600rpx;
		height: 80rpx;
		border-radius: 10rpx;
	}

	.login {
		height: 100vh;
		padding-bottom: 20vh;
	}

	.logo {
		width: 100rpx;
		height: 100rpx;
	}
</style>